<div id="menu">
	<ul>
		<li>
			<a href="index.php">Home</a>
		</li>
		<?php
		// Stock Charts menu item
		if(check_access('content_stockcharts')) {
			echo '<li>';
			echo '<a href="content_stockcharts.php"> - Stock Charts</a>';
			echo '</li>';
		}
		
		// Finance menu item
		if(check_access('content_finance')) {
			echo '<li>';
			echo '<a href="content_finance.php"> - Finance</a>';
			echo '</li>';
		}
		?>
		<li>
			<a style="border-bottom: 1px solid #DEDEDE;" href="logout.php">Logout</a>
		</li>
	</ul>
</div>

<?php
function check_access($content) {
	// Checks if the user has rights to access the current menu item
	if(isset($_SESSION[$content])) {
		if($_SESSION[$content] != 1) {
			return 0;
		} else {
			return 1;
		}
	}
}
?>